<?php include load_tpl('header');?>
<p id="breadcrumbs">
    <a href="/">首页</a> <b>»</b> 
    <span>产品列表</span>
</p>

<div class="box">
  <div class="left"></div>
  <div class="right"></div>
  <div class="heading">
    <h1 style="background-image: url('./images/product.png');">产品列表</h1>
    <div class="buttons"><a class="button" onclick="location = 'index.php?mod=product&act=add'"><span>添加产品</span></a></div>
  </div>
  <div class="content">
    <form id="form" enctype="multipart/form-data" method="post" action="">
      <table class="list">
        <thead>
          <tr style="background-color: rgb(244, 244, 248);">
            <td width="1" style="text-align: center;"><input type="checkbox" onclick="$('input[name*=\'selected\']').attr('checked', this.checked);"></td>
            <td class="center">图片</td>
            <td class="left">产品名称
              </td>
            <td class="left">模型
              </td>
            <td class="left">价格
              </td>
            <td class="right">数量
              </td>
            <td class="left">状态
              </td>
            <td class="right">操作</td>
          </tr>
        </thead>
        <tbody>
		<!--
          <tr class="filter">
            <td></td>
            <td></td>
            <td><input type="text" value="" name="filter_name"></td>
            <td><input type="text" value="" name="filter_model"></td>
            <td><input type="text" value="" name="filter_price"></td>
            <td align="right"><input type="text" style="text-align: right;" value="" name="filter_quantity"></td>
            <td><select name="filter_status">
                <option value="*"></option>
				<option value="1">上架</option>
			<option value="0">下架</option>
		  </select></td>
            <td align="right"><a class="button" onclick="filter();"><span>过滤</span></a></td>
          </tr>
		  -->
		  <?php if($pro_list){
				foreach($pro_list as $p){
				
		 ?>
		 <tr style="background-color: rgb(244, 244, 248);">
            <td style="text-align: center;"> <input type="checkbox" value="42" name="selected[]">
              </td>
            <td class="center"><img style="padding: 1px; border: 1px solid #DDDDDD;" alt="商品图片" src="<?php echo './product_images/'.$p['product_thumb'];?>"></td>
            <td class="left"><?php echo $p['name'];?></td>
            <td class="left"><?php echo $p['model'];?></td>
            <td class="left"><?php echo $p['price'];?></td>
            <td class="right"><span style="color: #008000;"><?php echo $p['quantity'];?></span></td>
            <td class="left"><?php if($p['status']==1)echo '上架'; else echo '下架';?></td>
            <td class="right"><a class="button" href="index.php?mod=product&act=edit&product_id=<?php echo $p['product_id'];?>"><span>编辑</span></a>
			<a class="button" href="index.php?mod=product&act=del&product_id=<?php echo $p['product_id'];?>"><span>删除</span></a>
			<a class="button" href="index.php?mod=product&act=upload&product_id=<?php echo $p['product_id'];?>"><span>编辑图片</span></a>
             </td>
          </tr>
		 <?php
				}
		  }
		  ?>
        </tbody>
      </table>
    </form>
    <div class="pagination"><div class="results"><?php if(isset($pages)) echo $pages;?></div></div>
  </div>
</div>

<?php include load_tpl('footer');?>